inherited sprAbonentTraits: TsprAbonentTraits
  Left = 396
  Top = 242
  Caption = #1057#1087#1088#1072#1074#1086#1095#1085#1080#1082' '#1087#1088#1080#1079#1085#1072#1082#1086#1074' '#1072#1073#1086#1085#1077#1085#1090#1072
  PixelsPerInch = 96
  TextHeight = 13
  inherited Panel2: TPanel
    Top = 25
    Height = 529
    inherited PageControl1: TPageControl
      Height = 529
      inherited tsTab: TTabSheet
        inherited GroupBox3: TGroupBox
          Height = 501
          inherited dbgRefer: TDBGridEh
            Height = 484
            Columns = <
              item
                EditButtons = <>
                FieldName = 'ID'
                Footers = <>
              end
              item
                EditButtons = <>
                FieldName = 'NAME'
                Footers = <>
              end
              item
                EditButtons = <>
                FieldName = 'CODE'
                Footers = <>
              end
              item
                EditButtons = <>
                FieldName = 'CREATEDATE'
                Footers = <>
                Visible = False
              end
              item
                EditButtons = <>
                FieldName = 'CREATEUSERID'
                Footers = <>
                Visible = False
              end
              item
                EditButtons = <>
                FieldName = 'MODIFYDATE'
                Footers = <>
                Visible = False
              end
              item
                EditButtons = <>
                FieldName = 'MODIFYUSERID'
                Footers = <>
                Visible = False
              end>
          end
        end
      end
      inherited tsForm: TTabSheet
        inherited GroupBox2: TGroupBox
          Top = 0
          Width = 784
          Height = 501
          Align = alClient
          inherited pnlButtons: TPanel
            Top = 468
            Width = 780
            TabOrder = 2
            inherited SpeedButton1: TSpeedButton
              Left = 581
            end
            inherited SpeedButton2: TSpeedButton
              Left = 683
            end
          end
          object GroupBox4: TGroupBox
            Left = 2
            Top = 98
            Width = 780
            Height = 370
            Align = alClient
            Caption = '                   '
            TabOrder = 1
            object cbEnableValueList: TDBCheckBoxEh
              Left = 12
              Top = 0
              Width = 110
              Height = 13
              AlwaysShowBorder = True
              Caption = #1057#1087#1080#1089#1086#1082' '#1079#1085#1072#1095#1077#1085#1080#1081
              Flat = True
              TabOrder = 0
              ValueChecked = 'True'
              ValueUnchecked = 'False'
              OnClick = cbEnableValueListClick
            end
            object dbgValueList: TDBGridEh
              Left = 2
              Top = 15
              Width = 776
              Height = 353
              Align = alClient
              DataGrouping.GroupLevels = <>
              DataSource = dscValueList
              Flat = True
              FooterColor = clWindow
              FooterFont.Charset = DEFAULT_CHARSET
              FooterFont.Color = clWindowText
              FooterFont.Height = -11
              FooterFont.Name = 'MS Sans Serif'
              FooterFont.Style = []
              Options = [dgEditing, dgTitles, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit]
              RowDetailPanel.Color = clBtnFace
              TabOrder = 1
              TitleFont.Charset = DEFAULT_CHARSET
              TitleFont.Color = clWindowText
              TitleFont.Height = -11
              TitleFont.Name = 'MS Sans Serif'
              TitleFont.Style = []
              UseMultiTitle = True
              VTitleMargin = 5
              Columns = <
                item
                  EditButtons = <>
                  FieldName = 'ID'
                  Footers = <>
                  Visible = False
                end
                item
                  EditButtons = <>
                  FieldName = 'TRAIT_ID'
                  Footers = <>
                  Visible = False
                end
                item
                  EditButtons = <>
                  FieldName = 'NAME'
                  Footers = <>
                end>
              object RowDetailData: TRowDetailPanelControlEh
              end
            end
          end
          object Panel1: TPanel
            Left = 2
            Top = 15
            Width = 780
            Height = 83
            Align = alTop
            BevelOuter = bvNone
            TabOrder = 0
            object Label3: TLabel
              Left = 85
              Top = 58
              Width = 19
              Height = 13
              Alignment = taRightJustify
              Caption = #1050#1086#1076
            end
            object Label2: TLabel
              Left = 54
              Top = 34
              Width = 50
              Height = 13
              Alignment = taRightJustify
              Caption = #1053#1072#1079#1074#1072#1085#1080#1077
            end
            object Label1: TLabel
              Left = 87
              Top = 10
              Width = 17
              Height = 13
              Alignment = taRightJustify
              Caption = #1048#1044
            end
            object dbeCode: TDBEditEh
              Left = 112
              Top = 55
              Width = 121
              Height = 19
              AlwaysShowBorder = True
              DataField = 'CODE'
              DataSource = dscRefer
              EditButtons = <>
              Flat = True
              TabOrder = 2
              Visible = True
            end
            object dbeID: TDBEditEh
              Left = 112
              Top = 7
              Width = 121
              Height = 19
              AlwaysShowBorder = True
              Color = clInactiveCaptionText
              DataField = 'ID'
              DataSource = dscRefer
              EditButtons = <>
              Flat = True
              ReadOnly = True
              TabOrder = 0
              Visible = True
            end
            object dbeName: TDBEditEh
              Left = 112
              Top = 31
              Width = 121
              Height = 19
              AlwaysShowBorder = True
              DataField = 'NAME'
              DataSource = dscRefer
              EditButtons = <>
              Flat = True
              TabOrder = 1
              Visible = True
            end
          end
        end
      end
    end
  end
  inherited GroupBox1: TGroupBox
    Height = 0
    Visible = False
  end
  inherited dsRefer: TpFIBDataSet
    UpdateSQL.Strings = (
      'UPDATE ABONENT_TRAITS'
      'SET '
      '    NAME = :NAME,'
      '    CODE = :CODE'
      'WHERE'
      '    ID = :OLD_ID'
      '    ')
    DeleteSQL.Strings = (
      'DELETE FROM'
      '    ABONENT_TRAITS'
      'WHERE'
      '        ID = :OLD_ID'
      '    ')
    InsertSQL.Strings = (
      'INSERT INTO ABONENT_TRAITS('
      '    NAME,'
      '    CODE,'
      '    CREATEDATE,'
      '    CREATEUSERID,'
      '    MODIFYDATE,'
      '    MODIFYUSERID'
      ')'
      'VALUES('
      '    :NAME,'
      '    :CODE,'
      '    :CREATEDATE,'
      '    :CREATEUSERID,'
      '    :MODIFYDATE,'
      '    :MODIFYUSERID'
      ')'
      'returning id')
    RefreshSQL.Strings = (
      'SELECT'
      '    ID,'
      '    NAME,'
      '    CODE,'
      '    CREATEDATE,'
      '    CREATEUSERID,'
      '    MODIFYDATE,'
      '    MODIFYUSERID,'
      
        '    iif(exists(select 1 from abonent_traits_values atv where atv' +
        '.trait_id = a.id), 1, 0) as exist_list'
      'FROM'
      '    ABONENT_TRAITS a'
      'WHERE '
      '    A.ID = :OLD_ID'
      '    ')
    SelectSQL.Strings = (
      'SELECT'
      '    ID,'
      '    NAME,'
      '    CODE,'
      '    CREATEDATE,'
      '    CREATEUSERID,'
      '    MODIFYDATE,'
      '    MODIFYUSERID,'
      
        '    iif(exists(select 1 from abonent_traits_values atv where atv' +
        '.trait_id = a.id), 1, 0) as exist_list'
      'FROM'
      '    ABONENT_TRAITS a')
    UpdateTransaction = trRefer
    object dsReferID: TFIBIntegerField
      DisplayLabel = #1048#1044
      FieldName = 'ID'
    end
    object dsReferNAME: TFIBStringField
      DisplayLabel = #1053#1072#1079#1074#1072#1085#1080#1077
      DisplayWidth = 30
      FieldName = 'NAME'
      Size = 60
      EmptyStrToNull = True
    end
    object dsReferCODE: TFIBStringField
      DisplayLabel = #1050#1086#1076
      FieldName = 'CODE'
      Size = 16
      EmptyStrToNull = True
    end
    object dsReferCREATEDATE: TFIBDateField
      FieldName = 'CREATEDATE'
    end
    object dsReferCREATEUSERID: TFIBIntegerField
      FieldName = 'CREATEUSERID'
    end
    object dsReferMODIFYDATE: TFIBDateField
      FieldName = 'MODIFYDATE'
    end
    object dsReferMODIFYUSERID: TFIBIntegerField
      FieldName = 'MODIFYUSERID'
    end
    object dsReferEXIST_LIST: TFIBIntegerField
      FieldName = 'EXIST_LIST'
    end
  end
  inherited trRefer: TpFIBTransaction
    Top = 280
  end
  object dsValueList: TpFIBDataSet
    UpdateSQL.Strings = (
      'UPDATE ABONENT_TRAITS_VALUES'
      'SET '
      '    NAME = :NAME'
      'WHERE'
      '    ID = :OLD_ID'
      '    ')
    DeleteSQL.Strings = (
      'DELETE FROM ABONENT_TRAITS_VALUES'
      '  WHERE ID = :OLD_ID')
    InsertSQL.Strings = (
      'INSERT INTO ABONENT_TRAITS_VALUES('
      '    ID,'
      '    TRAIT_ID,'
      '    NAME'
      ')'
      'VALUES('
      '    :ID,'
      '    :TRAIT_ID,'
      '    :NAME'
      ')'
      'returning id')
    RefreshSQL.Strings = (
      'SELECT'
      '    ID,'
      '    TRAIT_ID,'
      '    NAME'
      '  FROM ABONENT_TRAITS_VALUES '
      '  WHERE ABONENT_TRAITS_VALUES.ID = :OLD_ID')
    SelectSQL.Strings = (
      'SELECT'
      '    ID,'
      '    TRAIT_ID,'
      '    NAME'
      'FROM ABONENT_TRAITS_VALUES '
      'where TRAIT_ID = :TRAIT_ID'
      'order by name')
    BeforePost = dsValueListBeforePost
    Transaction = trRefer
    Database = MAINDM.pMainDatabase
    Left = 198
    Top = 203
    object dsValueListID: TFIBIntegerField
      FieldName = 'ID'
    end
    object dsValueListTRAIT_ID: TFIBIntegerField
      FieldName = 'TRAIT_ID'
    end
    object dsValueListNAME: TFIBStringField
      DisplayLabel = #1053#1072#1080#1084#1077#1085#1086#1074#1072#1085#1080#1077
      DisplayWidth = 40
      FieldName = 'NAME'
      Size = 60
      EmptyStrToNull = True
    end
  end
  object dscValueList: TDataSource
    DataSet = dsValueList
    Left = 230
    Top = 203
  end
end
